<admintpl file="header" />
<style>
.table tbody{text-align:center;}
.const{margin-bottom:10px;}
.const a,.const span{font-size:12px;color:#333;}
.const a{margin-right:15px;}
.const_type a{margin-right:15px;}
.const a{cursor: pointer;}
.const .select{color:#337ab7;}
.const_type .search{float:right; margin-right:5px;font-size:14px;}
.down{color:black;}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('BimModel/index')}">{:L('ADMIN_BIMMODEL_INDEX')}</a></li>
			<php>
				$role = session('Role');
				if(session('ADMIN_ID') == 1 || (session('deptid') == 1 && session('Role') != 1) || (session('deptid') == 3 && session('Role') != 1)){
			</php>
			<li><a href="{:U('BimModel/add')}">{:L('ADMIN_BIMMODEL_UPLOAD')}</a></li>
			<li><a href="{:U('BimModel/add_version')}">{:L('ADMIN_BIMMODEL_ADD_VERSION')}</a></li>
			<php>}</php>
		</ul>
        <form class="well form-search form-inline" method="post" action="{:U('BimModel/index')}">
			<div class="const">
			<span>按施工阶段：</span>
			<a href='{:U("BimModel/index",array("construction_id"=>"all"))}' <php>if($construction_id == 'all'){echo "class='select'";}</php> >全部</a>
			<a href='{:U("BimModel/index",array("construction_id"=>1))}' <php>if($construction_id == 1){echo "class='select'";}</php>>方案阶段</a>
			<a href='{:U("BimModel/index",array("construction_id"=>2))}' <php>if($construction_id == 2){echo "class='select'";}</php>>扩初阶段</a>
			<a href='{:U("BimModel/index",array("construction_id"=>3))}' <php>if($construction_id == 3){echo "class='select'";}</php>>施工图阶段(设计)</a>
			<a href='{:U("BimModel/index",array("construction_id"=>4))}' <php>if($construction_id == 4){echo "class='select'";}</php>>施工图阶段(施工)</a>
			</div>
			<div class="const">
			<span>按版本分类：</span>
			<a href='{:U("BimModel/index",array("version_id"=>"all"))}' <php>if($version_id == 'all'){echo "class='select'";}</php> >全部</a>
			<foreach name="versions" item="vo">
			<a href='{:U("BimModel/index",array("version_id"=>$vo["id"]))}' <php>if($version_id == $vo['id']){echo "class='select'";}</php> >{$vo.version_name}版本</a>
			</foreach>
			</div>
			<div class="const_type const">
			<span>按专业类型：</span>
			<a href='{:U("BimModel/index",array("type_id"=>"all"))}' <php>if($type_id == 'all'){echo "class='select'";}</php> >全部</a>
			<foreach name="types" item="vo">
			<a href='{:U("BimModel/index",array("type_id"=>$vo["id"]))}'  <php>if($type_id == $vo['id']){echo "class='select'";}</php> >{$vo.type_name}</a>
			</foreach>
			
			<a class="btn btn-danger search" href="{:U('BimModel/index')}">清空</a>
			<button class="btn btn-primary search" type="submit">搜索</button>
			<div class="form-group search">
                <!--<label >账号</label>-->
                <input type="text" name="file_name" class="form-control"   value="{$file_name}" placeholder="请输入图纸名称/图号">
            </div>
            
			</div>
            
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th>序号</th>
					<th>工程类别</th>
					<th>模型号</th>
					<th>模型名称</th>
					<!--<th>图幅</th>
					<th>张数</th>-->
					<th width="200">上传时间</th>
					<th>大小</th>
					<th>下载</th>
					<th>上传人</th>
					<th>单位</th>
					<th width="120">{:L('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				
				<foreach name="results" item="vo">
				<tr>
					<td>{$vo.ordernum}</td>
					<td>{$vo.type_name}</td>
					<td>{$vo.figure_num}</td>
					<td><a href='{:U("DrawingUpload/download",array("url"=>$vo["file_path"],"file_name"=>$vo["file_name"],"file_type"=>$vo["file_type"]))}' class="down" alt="下载"><img src="__PUBLIC__/images/dwf.gif" width="16px;" height="16px;"/> {$vo.file_name}.{$vo.file_type}</a></td>
					<!--<td>{$vo.sheet}</td>
					<td>{$vo.sheets}</td>-->
					<td>{$vo.upload_time|date="Y-m-d H:i:s",###}</td>
					<td>{$vo.file_size}KB</td>
					<td><a href='{:U("DrawingUpload/download",array("url"=>$vo["file_path"],"file_name"=>$vo["file_name"],"file_type"=>$vo["file_type"]))}' alt="下载">下载</a></td>
					<td>{$vo.real_name}</td>
					<td>{$vo.department_name}</td>
					<td>
						<a href='{:U("BimModel/edit",array("id"=>$vo["id"]))}'>{:L('EDIT')}</a> |
						<a class="js-ajax-delete" href="{:U('BimModel/delete',array('id'=>$vo['id']))}">{:L('DELETE')}</a> 
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>